package com.example.controller;

import com.example.demo.user;
import com.example.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@Controller
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/tofind")
    public String showname(HttpServletRequest request) {
        String email = userMapper.findEmail("小明");
        System.out.println(email);
        request.setAttribute("email", email);
        System.out.println(request.getAttribute("email"));
        return "login";
    }

}







